<template>
	<div>
		<div class="box">
			<div class="title">
				<span class="tag"></span>
				租金调整-维保
			</div>
			<AFrom v-model="formData" :config="formList" :state="state"></AFrom>
		</div>
	</div>
</template>

<script>
	import AFrom from '@/components/A/A-form/form/index.vue';
	export default {
		name: '',
		components: { AFrom },
		props: {
			value: {
				type: Object,
				default: () => {
					return {};
				},
			},
			state: {
				required: false,
			},
		},
		dicts: ['quota_maintenance_mileage_type'],
		data() {
			return {
				dictList: {
					maintenanceSupplierId: [
						{
							label: '4s',
							value: 1,
						},
						{
							label: '维修厂',
							value: 2,
						},
					],
				},
			};
		},
		computed: {
			formData: {
				get() {
					return this.useVModel.call(this);
				},
				set(val) {
					this.$emit('input', val);
				},
			},
			formList() {
				return [
					{
						label: '原年行驶公里数',
						prop: 'a',
						state: 'readonly',
					},
					{
						label: '原维保费用',
						prop: 'a',
						type: 'price',
						state: 'readonly',
					},
					{
						label: '是否包含维保',
						prop: 'a',
						state: 'readonly',
					},
					{
						label: '原供应商',
						prop: 'a',
						state: 'readonly',
					},
					{
						label: '原合同是否限制里程',
						prop: 'a',
						state: 'readonly',
					},
					{
						label: '调整年行驶公里数',
						prop: 'a',
						type: 'select',
						dict: {
							list: this.maintenanceAnnualMileageKeyList,
						},
					},
					{
						label: '调整是否包含维保',
						prop: 'a',
						type: 'radioGroup',
						dict: {
							list: [
								{ label: '是', value: 1 },
								{ label: '否', value: 2 },
							],
						},
					},
					{
						label: '调整维保费用',
						prop: 'a',
						type: 'price',
					},
					{
						label: '调整供应商',
						prop: 'a',
						type: 'select',
						dict: {
							list: this.dictList.maintenanceSupplierId,
						},
					},
					{
						label: '调整是否限制里程',
						prop: 'a',
						type: 'radioGroup',
						dict: {
							list: this.dict.type.quota_maintenance_mileage_type,
						},
					},
				];
			},
			maintenanceAnnualMileageKeyList() {
				let arr = [],
					start = 10000,
					end = 80000;
				for (let i = start; i <= end; i += 10000) {
					arr.push({
						label: i,
						value: i,
					});
				}
				return arr;
			},
		},
		created() {},
		mounted() {},
		methods: {},
	};
</script>

<style lang="scss" scoped>
	.box {
		border-radius: 8px;
		background-color: #fff;
		.title {
			font-size: 14px;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 22px;
			padding-top: 15px;
			padding-bottom: 15px;
			// border-bottom: 1px solid #e9e9e9;
			display: flex;
			align-items: center;
			.tag {
				width: 8px;
				height: 8px;
				background-color: #1890ff;
				border-radius: 100%;
				margin-right: 10px;
			}
			.price {
				font-size: 14px;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #1890ff;
				line-height: 20px;
				margin-left: 20px;
			}
		}
	}
</style>
